﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Entetities;


namespace DAL
{
   public class NhomSanPhamDAL
    {
        DataHelper dh;
        DataTable dt;
        public NhomSanPhamDAL()
        {
            dh = new DataHelper();
        }
        public DataTable Laynhomsanphamcha()
        {
            try
            {
                dt = new DataTable();
                dt = dh.FieldSortTableSP("ProductGroup_GetParent");
            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }
        public DataTable Laynhomsanphamcon(int manhomcha)
        {
            try
            {
                dt = new DataTable();
                SqlParameter para = new SqlParameter("@ParentId", manhomcha);
                dt = dh.FieldSortTableSP("ProductGroup_GetChildrent", para);
            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }
    }
}
